﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T01
{
    class Program
    {
        static void Main(string[] args)
        {
            MyMath a = new MyMath();
            Console.WriteLine("最小公倍数是{0}",a.Lcm(60,90));
            Console.WriteLine("最大公约数是{0}", a.Gct(60, 90));
            Console.ReadKey();
        }
    }
    class MyMath
    {
        public  int Lcm (int a,int b)
        {
            int i = 1,k;
            k = a;
         while(a%b!=0)
            {
                
                a = k * i;
                i++;
            }
            return a;
        }
        public int Gct(int a, int b)
        {
            int k = a<b?a:b;
            while(a%k!=0|| b % k != 0)
            {
                k--;
            }
            return k;
        }
    }
}
